home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / utils / sleep.arc / SLEEPNN.C next >
C/C++ Source or Header  |  1989-04-30  |  1KB  |  50 lines

  1. /*
  2.  *    SLEEPnn.PRG  -- A utility to allow your Atari ST to take a nap
  3.  *    so that your hard drive can have time to power up.
  4.  *    Ideal for recovering a BBS automatically after a power
  5.  *     failure. Put this in the \auto\ folder of your FLOPPY drive,
  6.  *    followed by your hard disk driver (AHDI.PRG, SUPBOOT.PRG, etc.)
  7.  *    Name the program SLEEP15.PRG, SLEEP30.PRG, etc.
  8.  */
  9.  
  10. #include <stdio.h>
  11. #include <ctype.h>
  12.  
  13. #define VSN "1.0 \n Compiled with Sozobon C \n -- 04/30/1989\n"
  14.  
  15. main(argc, argv) 
  16. int argc; char *argv[];
  17. {
  18.     int tm;
  19.     char *ptr;
  20.  
  21.     printf("SLEEP version %s\n", VSN);
  22.     printf("Public domain by Steve Yelvington\n");
  23.     printf("UUCP: bungia!stag!thelake!steve\n\n");
  24.     ptr = argv[0];
  25.     while ( *ptr)
  26.         ++ptr;            /* find the end of the string */
  27.     ptr -= 6;            /* back up nn.prg             */
  28.  
  29.     if ( isdigit(*ptr) )
  30.         {
  31.         tm = atoi(ptr);
  32.         printf("%s: Pausing %d seconds\n", argv[0], tm);
  33.         sleep(tm);
  34.         }
  35.     else 
  36.         {
  37.         printf("This is %s ... \n", argv[0]);
  38.         printf("This program should be renamed    \n");
  39.         printf("SLEEPnn.PRG, where nn is 00 to 99,\n");
  40.         printf("two digits indicating how many    \n");
  41.         printf("seconds you wish to wait for the  \n");
  42.         printf("hard drive to get up to speed.    \n");
  43.         printf("\n(Press any key to exit)         \n");
  44.         getch();
  45.         }
  46.     
  47.     exit(0);
  48. }
  49.  
  50.